package o;

import androidx.annotation.Nullable;
import java.util.UUID;

public final class aff {

    static class c {
        private final byte[] ˊ;
        private final UUID ˋ;
        private final int ॱ;

        public c(UUID uuid, int i, byte[] bArr) {
            this.ˋ = uuid;
            this.ॱ = i;
            this.ˊ = bArr;
        }
    }

    @Nullable
    public static UUID ˎ(byte[] bArr) {
        c ˏ = ˏ(bArr);
        if (ˏ == null) {
            return null;
        }
        return ˏ.ˋ;
    }

    @Nullable
    private static c ˏ(byte[] bArr) {
        anc o_anc = new anc(bArr);
        if (o_anc.ॱ() < 32) {
            return null;
        }
        o_anc.ˋ(0);
        if (o_anc.ॱᐝ() != o_anc.ˊ() + 4 || o_anc.ॱᐝ() != aeu.ᐝᐝ) {
            return null;
        }
        int ॱ = aeu.ॱ(o_anc.ॱᐝ());
        if (ॱ > 1) {
            amz.ˏ("PsshAtomUtil", "Unsupported pssh version: " + ॱ);
            return null;
        }
        UUID uuid = new UUID(o_anc.ॱˎ(), o_anc.ॱˎ());
        if (ॱ == 1) {
            o_anc.ˎ(o_anc.ʽॱ() * 16);
        }
        int ʽॱ = o_anc.ʽॱ();
        if (ʽॱ != o_anc.ˊ()) {
            return null;
        }
        byte[] bArr2 = new byte[ʽॱ];
        o_anc.ˎ(bArr2, 0, ʽॱ);
        return new c(uuid, ॱ, bArr2);
    }
}
